package com.wyz.saas.app.mvvm

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.wyz.saas.app.mvvm.list.ListViewModel

class ViewModelFactory : ViewModelProvider.NewInstanceFactory() {

    companion object {
        val sInstance by lazy { ViewModelFactory() }
    }

    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        if (ListViewModel::class.java.isAssignableFrom(modelClass)) {
            return ListViewModel() as T
        }
        return super.create(modelClass)
    }
}